package com.ryskoo.framework.core.consumer;

import com.ryskoo.common.dto.BasicDTO;
import com.ryskoo.framework.core.bean.QueryMessageDTO;
import com.ryskoo.framework.core.bean.ReturnMessageDTO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 后端权限系统调用
 * 
 * @author ddy
 *
 */
public interface BasicConsumer<DTO extends BasicDTO> {
	@GetMapping(value = "/get/{id}")
    ReturnMessageDTO<DTO> getById(@PathVariable(value = "id") String id);

    @PostMapping(value = "/getAll")
    ReturnMessageDTO<List<DTO>> getAll();

	@PostMapping(value = "/list")
	ReturnMessageDTO<List<DTO>> getList(@RequestBody() QueryMessageDTO queryMessage);
	
	@PostMapping(value = "/listAll")
	ReturnMessageDTO<List<DTO>> getListAll(@RequestBody() QueryMessageDTO queryMessage);

    @PostMapping(value = "/create")
    ReturnMessageDTO<DTO> create(@RequestBody() DTO dto);

    @PostMapping(value = "/update")
    ReturnMessageDTO<DTO> update(@RequestBody() DTO dto);

    @PostMapping(value = "/delete")
    ReturnMessageDTO delete(@RequestBody() List<String> idList);
}
